package jdmx.library.da;



import jdmx.library.info.DbInfo;

import org.apache.commons.dbcp.BasicDataSource;


public class DatabaseMsAccess extends Database {

	@Override
	public void init(DbInfo dbInfo) {
		
		// For Access
		//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		//String myDB = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/data/month.MDB";
		//DBConn = DriverManager.getConnection(myDB,"","");

		// For Excel
		//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		//String myDB = "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=c:/data/month.xls;" + "DriverID=22;READONLY=false";
		//DriverManager.getConnection(myDB,"","");
		
        dataSource = new BasicDataSource();
        dataSource.setDriverClassName("sun.jdbc.odbc.JdbcOdbcDriver");
        dataSource.setUsername(dbInfo.dbUsername);
        dataSource.setPassword(dbInfo.dbPassword);
        dataSource.setUrl("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + dbInfo.dbServer + "/" + dbInfo.dbName + ".MDB");
        
        //"C:/data" e dbServer
	}
}

           
       